/**
 * 致命错误
 */
export class FatalError extends Error {
  constructor(message: string, code?: number | string) {
    super(message)
    this.name = 'FatalError'
    this.code = code
  }

  code?: number | string

  static isFatalError(error: any): error is FatalError {
    return error instanceof FatalError
  }
}
